package com.lagou.demo.service;

import com.lagou.demo.dao.StudentDao;
import com.lagou.demo.pojo.Page;
import com.lagou.demo.pojo.Student;
import com.lagou.demo.pojo.User;
import com.lagou.demo.dao.UserDao;
import com.lagou.demo.factory.DaoFactory;

import java.util.List;

/**
 * 定义StudentService调用studentDao的实现类实现增删改查方法
 */
public class StudentService {
    private StudentDao studentDao;

    public StudentService() {
        this.studentDao = DaoFactory.getStudentDao();
    }

    public int StudentAdd(Student student) {
        return studentDao.StudentAdd(student);
    }

    public int StudentDelete(String[] id) {
        return studentDao.StudentDelete(id);
    }

    public int StudentUpdate(Student student) {
        return studentDao.StudentUpdate(student);
    }

    public Student StudentFind(int id){
        return studentDao.StudentFind(id);
    }

    public List<Student> StudentSearch(Page page) {
        return studentDao.StudentSearch(page);
    }
}
